package com.leonzhangxf.ioc.injection.method;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * The demo of use method injection.
 *
 * @author leonzhangxf
 */
@Configuration
@ComponentScan("com.leonzhangxf.ioc.injection.method")
public class ApplicationContextForMethodInjectionStarter {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext =
            new AnnotationConfigApplicationContext(ApplicationContextForMethodInjectionStarter.class);

        CommandManager commandManager = applicationContext.getBean(CommandManager.class);
        commandManager.process("hello leon");
        commandManager.process("hello maggie");
    }
}
